<?php
/**
 * Created by PhpStorm.
 * User: moquan
 * Date: 2018/7/11
 * Time: 18:27
 */

namespace app\lib\wx;


use think\Log;

class Application {

    public $appID;

    public $appSecret;

    public $accessToken;

    public $app;


    function __construct() {
        $this->appID = config( 'wx.appId' );
        $this->appSecret = config( 'wx.appSecret' );
        $accToken = new AccessToken();
        $this->accessToken = $accToken->getAccessToken();
    }

    function getApp(){
        return $this->app;
    }

    function __call( $name, $arg ){
        $class =  __NAMESPACE__.'\\'.ucfirst($name);
            return new $class;
    }


    protected function recordErrorLog( $data ) {
        Log::init([
            'type' => 'File',
            'path' => LOG_PATH,
            'level' => ['error']
        ]);
        Log::record( $data, 'error' );
    }
    //取到accessToken

    //网页授权

    //模板消息

    //菜单
}